# -*- coding:utf-8 -*-
# @time    : 2021/10/15 23:31
# @Author  : zhang jin xia
# @Filename: PyCharm
from api.page.base import Base


class RequestMethods(Base):

    def get(self, params=None, headers=None):
        url = "https://httpbin.testing-studio.com/get"
        send_data = {
            "method": "get",
            "url": url,
            "params": params,
            "headers": headers
        }
        return self.send(send_data)

    def post(self, params=None, headers=None, data=None, json=None):
        url = "https://httpbin.testing-studio.com/post"
        send_data = {
            "method": "post",
            "url": url,
            "params": params,
            "headers": headers,
            "data": data,
            "json": json
        }
        return self.send(send_data)

    def put(self, params=None, headers=None, data=None, json=None):
        url = "https://httpbin.testing-studio.com/put"
        send_data = {
            "method": "put",
            "url": url,
            "params": params,
            "headers": headers,
            "data": data,
            "json": json
        }
        return self.send(send_data)

    def delete(self, params=None, headers=None, data=None, json=None):
        url = "https://httpbin.testing-studio.com/delete"
        send_data = {
            "method": "delete",
            "url": url,
            "params": params,
            "headers": headers,
            "data": data,
            "json": json
        }
        return self.send(send_data)

    def patch(self, params=None, headers=None, data=None, json=None):
        url = "https://httpbin.testing-studio.com/patch"
        send_data = {
            "method": "patch",
            "url": url,
            "params": params,
            "headers": headers,
            "data": data,
            "json": json
        }
        return self.send(send_data)

